﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.IO;
using System.Linq;
using System.Text.RegularExpressions;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using iShoppingBUS;
using iShoppingDTO;

namespace iShopping.Admin
{
    public partial class iShopping_Admin : System.Web.UI.MasterPage
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Session["username"] == null)
            {
                Response.Redirect("/Guest/LoginPage.aspx");
            }

            TaiKhoanDTO tk = new TaiKhoanDTO();
            lb_username.Text = (string)Session["username"];

            if (TaiKhoanBUS.LayMaLoaiTK(lb_username.Text) != "4")
            {
                Response.Redirect("/Guest/LoginPage.aspx");
                Session.Remove("username");
            }
            
        }
        protected void btnLogOut_Click(object sender, EventArgs e)
        {
            Session.Remove("username");
            Session.Remove("userid");
            Response.Redirect("/Guest/HomePage.aspx");
        }

       
    }
}
